package com.jiepu.daily.corejava.advanceed.part7io.day0806;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * @Description: 实际生产中 IO流使用 read() 方法 很少
 * @author: xinjie
 * @date: 2020/8/6  15:13
 */
public class IODemo2 {
	public static void main(String[] args) throws IOException {
		String filePath = "src/com/jiepu/daily/advanceed/part7_io/io_test/demo2.txt";
		InputStream inputStream = new FileInputStream(filePath);
		// 缓冲池
		byte[] buffs = new byte[10];
		int len = -1;
		while ((len = inputStream.read(buffs)) != -1) {

			for (int i = 0; i < len; i++) {
				System.out.print((char) buffs[i]);
			}

			/*String str = new String(buffs, 0, len);
			System.out.println(str);*/
		}


	}
}
